package com.jeecg.modules.jmreport.config;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.servlet.Filter;

@Configuration
public class FilterConfig {
    @Bean
    public FilterRegistrationBean filterRegistration() {
        FilterRegistrationBean<Filter> registration = new FilterRegistrationBean<>();
        registration.setFilter(CustomFilter());
        registration.addUrlPatterns("/*");
        registration.setName("addUserInfoFilter");
        return registration;
    }
    @Bean
    public Filter CustomFilter() {
        return new CustomFilter();
    }
}
